<template>
    <BMap v-if="!useBigeMap" 
        @initd="handleMapInitd" 
        @zoomend="handleZoomEnd" 
        @dragging="handleDragging" 
        @mousemove="handleMouseMove" 
        v-bind="{...$props, ...$attrs}"
        :ak="BDak"
    >
        <slot></slot>
    </BMap>
    <BigeMap v-if="useBigeMap == 'bigemap'" 
        @initd="handleMapInitd" 
        @zoomend="handleZoomEnd" 
        @dragging="handleDragging" 
        @mousemove="handleMouseMove" 
        v-bind="{...$props, ...$attrs}"
    >
        <slot></slot>
    </BigeMap>

    <TiandiMap v-if="useBigeMap == 'tiandimap'" 
        @initd="handleMapInitd" 
        @zoomend="handleZoomEnd" 
        @dragging="handleDragging" 
        @mousemove="handleMouseMove" 
        v-bind="{...$props, ...$attrs}"
    >
        <slot></slot>
    </TiandiMap>
</template>

<script lang="ts">
import {useBigeMap, map_set_baidu} from '@/consts';

export default defineComponent({
    // extends: ElSelect,
    // inheritAttrs: false,

    props: {
    },
    setup(props, {attrs}) {
    },
    data() {
        return {
            BDak: map_set_baidu.value.__getValueSync('browser_ak_limit_no'),
        }
    },
    computed: {
        useBigeMap() {
            return useBigeMap.value
        },
    },
    methods: {
        handleMapInitd(e:any) {
            const self: any = this;
            self.$emit('initd', e);
        },
        handleZoomEnd(e:any) {
            const self: any = this;
            self.$emit('zoomend', e);
        },
        handleDragging(e:any) {
            const self: any = this;
            self.$emit('dragging', e);
        },
        handleMouseMove(e:any) {
            const self: any = this;
            self.$emit('mousemove', e);
        },
    }
})
</script>
<style lang="scss" scoped>

</style>